home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK2.toast / Development Kits (Disc 2) / ScriptX / Draggable ScriptX Folders / utils / DTK / Examples / Custom Classes / util.fnc < prev   
Encoding:
Text File  |  1995-10-27  |  991 b   |  42 lines  |  [TEXT/ttxt]

  1. format debug "--  Compiling Utility Functions . . .\n" undefined undefined
  2.  
  3. function loadPict theFile->
  4. (
  5.     local pictStream := getStream theScriptDir name:theFile @readable
  6.     return importMedia theImportExportEngine pictStream @image @pict @bitmap
  7. )
  8.  
  9. function makeRGBBrush r g b -> ( return new brush color:(new RGBColor red:r green:g blue:b))
  10.  
  11. function makeBrush rgb -> ( return new brush color:(rgb))
  12.  
  13. function setCastInfo dirInfo ->
  14. (
  15.     castList := dirInfo[@cast]
  16.     castByName := dirInfo[@castNames]
  17.     return OK
  18. )
  19.  
  20. function castFromName castName ->
  21. (
  22.     local castNum := getKeyOne castByName (castName as String)
  23.     if castNum = empty do (
  24.         return empty
  25.     )
  26.     return castList[castNum]    
  27. )
  28.  
  29. function frameFromLabel theLabel dirInfo->
  30. (
  31.     local lblList := dirInfo[@markers]
  32.     for lblNum := 1 to lblList.size do (
  33.         if lblList[lblNum].label = theLabel do (
  34.             return lblList[lblNum].start
  35.         )
  36.     )
  37.     return 0
  38. )
  39.  
  40.  
  41. #(undefined,undefined,#("loadPict","makeRGBBrush","makeBrush","setCastInfo","castFromName"))
  42.